<template>
  <div class="login">
    <div class="content">
      <p class="login-title">登录</p>
      <div class="login-box">
        <div class="user">
          <span class="user-icon iconfont icon-yonghu"></span>
          <input type="text" placeholder="请输入用户名" />
        </div>
        <div class="password">
          <span class="iconfont icon-ziyuan"></span>
          <input :type="showPass" placeholder="请输入密码" />
          <span class="iconfont" :class="eye" @click="show"></span>
        </div>
      </div>
      <div class="login-btn">登录</div>
      <div class="login-des">
        <router-link to="/goods/title">忘记密码?</router-link>
        <router-link to="/goods/title">注册>></router-link>
      </div>
      <p class="login-other">其他登录方式</p>
      <div class="logo-box">
        <div class="logo"></div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      showPass: "password",
      eye: "icon-xianshi",
    };
  },
  methods: {
    //密码显示切换
    show() {
      if (this.showPass === "password") {
        this.showPass = "text";
        this.eye = "icon-tubiao-";
      } else {
        this.showPass = "password";
        this.eye = "icon-xianshi";
      }
    },
  },
};
</script>

<style lang="scss" scoped>
.login {
  width: 100%;
  height: 100%;
  background: url("../static/img/login-bg.png") no-repeat center;
  background-size: cover;
  overflow: hidden;
  .content {
    .login-title {
      font-size: 0.453333rem;
      color: #fff;
      text-align: center;
      margin-top: 0.853333rem;
    }
    .login-box {
      width: 8.666667rem;
      height: 6.133333rem;
      background-color: #fff;
      box-shadow: 2px 2px 3px rgba($color: #333, $alpha: 0.4);
      border-radius: 0.4rem;
      margin: 1.6rem auto;
      overflow: hidden;
      position: relative;
      .user {
        border-bottom: 1px solid #999;
        width: 7.733333rem;
        margin: 0 auto;
        margin-top: 1.066667rem;
        color: #cccccc;
        display: flex;
        justify-content: flex-start;
        align-items: center;
        input {
          border: none;
          outline: none;
          font-size: 0.533333rem;
          padding: 0.266667rem 0;
          padding-left: 0.32rem;
          padding-right: 0.32rem;
          color: #cccccc;
          width: 100%;
          box-sizing: border-box;
          &::placeholder {
            color: #cccccc;
          }
        }
        span {
          font-size: 0.746667rem;
          padding-bottom: 0.133333rem;
        }
      }
      .password {
        border-bottom: 1px solid #999;
        width: 7.733333rem;
        margin: 0 auto;
        margin-top: 1.066667rem;
        color: #cccccc;
        display: flex;
        justify-content: flex-start;
        align-items: center;
        input {
          border: none;
          outline: none;
          font-size: 0.533333rem;
          padding: 0.266667rem 0;
          padding-left: 0.32rem;
          padding-right: 0.32rem;
          color: #cccccc;
          width: 5.466667rem;
          &::placeholder {
            color: #cccccc;
          }
        }
        span {
          font-size: 0.746667rem;
          padding-bottom: 0.133333rem;
        }
      }
    }
    .login-btn {
      width: 8.666667rem;
      height: 1.28rem;
      background-image: linear-gradient(90deg, #4fb8fd, #5c9cfb);
      font-size: 0.426667rem;
      text-align: center;
      line-height: 1.28rem;
      margin: 0 auto;
      color: #fff;
      border-radius: 0.333333rem;
    }
    .login-des {
      width: 8.666667rem;
      margin: 0 auto;
      font-size: 0.4rem;
      color: #333;
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-top: 0.266667rem;
      font-weight: bold;
      box-sizing: border-box;
      padding: 0 0.133333rem;
    }
    .login-other {
      text-align: center;
      font-size: 0.4rem;
      color: #666;
      margin-top: 1.68rem;
    }
    .logo-box {
      padding: 0.4rem;
      border-radius: 50%;
      position: absolute;
      top: 2.133333rem;
      left: 50%;
      transform: translateX(-50%);
      z-index: 66;
      background-color: #fff;
      .logo {
        width: 1.253333rem;
        height: 1.106667rem;
        background: url("../static/img/login-log.png") no-repeat center;
        background-size: contain;
      }
    }
  }
}
</style>